package com.guzhen.wallpager;

import androidx.annotation.DimenRes;
import com.fun.funlivewallpaper.AppApplication;

public class ScreenHelper {
    public static int screenWidth;
    public static int screenHeight;

    public static int getDimensionPixelSize(@DimenRes int v) {
        return AppApplication.application.getResources().getDimensionPixelSize(v);
    }

    public static int getScreenWidth() {
        int v = ScreenHelper.screenWidth;
        if(v != 0) {
            return v;
        }

        int v1 = ScreenUtils.getScreenWidth();
        ScreenHelper.screenWidth = v1;
        return v1;
    }

    public static int getScreenHeight() {
        int v = ScreenHelper.screenHeight;
        if(v != 0) {
            return v;
        }

        int v1 = ScreenUtils.getScreenHeight();
        ScreenHelper.screenHeight = v1;
        return v1;
    }

    public static float getDimension(@DimenRes int v) {
        return AppApplication.getApplication().getResources().getDimension(v);
    }
}

